package com.example.demo.pojo.param;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

@Data
public class ParamReadRes {

    private String device;
    private String target;
    public Command command;
    public Converter port1;
    public Converter port2;
    public ServerInfo serverInfo;
    private String transtype;

    @Data
    public static class Command {

        @JsonProperty("DI")
        private String DI; //设备标识位
        @JsonProperty("QZ")
        private String QZ; //站台号
        @JsonProperty("ID")
        private String ID; //设备ID
        @JsonProperty("SN")
        private String SN;
        @JsonProperty("SETNET")
        private String SETNET;//通讯参数
        @JsonProperty("SWITCHAFC")
        private String SWITCHAFC; //AFC开关
        @JsonProperty("SWITCHSCAN")
        private String SWITCHSCAN;//扫频开关
        @JsonProperty("BANDWIDTH")
        private String BANDWIDTH;//扫描分辨率
        @JsonProperty("RADIO_BAUD")
        private String RADIO_BAUD;//探空仪空口速率
        @JsonProperty("LAT")
        private String LAT;//纬度
        @JsonProperty("LONG")
        private String LONG;//经度
        @JsonProperty("ALT")
        private String ALT;//海拔高度
        @JsonProperty("FREQ")
        private String FREQ;//工作频点

    }

    @Data
    public static class Converter {

        private String devMode;
        private String devType;
        @JsonProperty("baudrate")
        private String baudrate;
        @JsonProperty("databit")
        private String databit;
        private String parity;
        @JsonProperty("stopbit")
        private String stopbit;
        private String flowControl;
        private String dev;

    }
    @Data
    public static class ServerInfo {

        private String serverAddr1;
        private String serverPort1;
        private String serverAddr2;
        private String serverPort2;
        private String serverAddr3;
        private String serverPort3;
        private String serverAddr4;
        private String serverPort4;
        private String serverAddr5;
        private String serverPort5;
        private String serverAddr6;
        private String serverPort6;

    }


//    public static void main(String[] args) {
//
//        ParamDtoRes paramDtoRes = new ParamDtoRes();
//        paramDtoRes.setDevice("GTCZ1");
//        paramDtoRes.setTarget("YSRP");
//        paramDtoRes.setTranstype("1004");
//
//        Command command1 = new Command();
//        command1.setDI("YSRP");
//        command1.setQZ("00000");
//        command1.setSN("G1116000069012345670120210429001");
//        command1.setSETNET("118.190.175.215");
//        command1.setSWITCHAFC("0");
//        command1.setSWITCHSCAN("1");
//        command1.setBANDWIDTH("6,0");
//        command1.setRADIO_BAUD("2400");
//        command1.setLAT("39907500");
//        command1.setLONG("116388056");
//        command1.setALT("435");
//        command1.setFREQ("0,401131000,401131000,401131000,401131000,401131000,401131000,401131000,401131000");
//
//        paramDtoRes.setCommand(command1);
//
//        String jsonStr = JSONUtil.toJsonStr(paramDtoRes);
//        System.out.println(jsonStr);
//    }

}
